<template>
  <div>
    <div class="top">
      <!-- 头部组件 -->
      <!-- <MyHeader title="猫眼电影" :hasmenu="true" /> -->
      <MyHeader title="猫眼电影">
        <span class="iconfont icon-caidan"></span>
      </MyHeader>
      <!-- logo组件 -->
      <MyLogo />
      <!-- 导航组件 -->
      <MyNav />
    </div>

    <!-- <MyList /> -->

    <!-- 添加缓存组件 -->
    <!-- 根据路由元信息，来判断一个页面是否需要做缓存 -->
    <!-- <keep-alive>
      <router-view v-if="$route.meta.requireAlive" />
    </keep-alive>
    <router-view v-if="!$route.meta.requireAlive" /> -->

    <transition name="fade" mode="in-out">
      <router-view />
    </transition>
  </div>
</template>

<script>
import MyHeader from "@/components/public/MyHeader.vue";
import MyLogo from "@/components/home/hot/MyLogo.vue";
import MyNav from "@/components/home/hot/MyNav.vue";
// import MyList from "@/components/home/MyList.vue";
export default {
  components: {
    MyHeader,
    MyLogo,
    MyNav,
    // MyList,
  },
};
</script>

<style lang="less" scoped>
.top {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
}

.fade-enter-active,
.fade-leave-active {
  transition: all 0.5s;
}
// .fade-enter, .fade-leave-to {
//   opacity: 0;
// }
.fade-enter,
.fade-leave-to {
  opacity: 0;
  transform: translateX(100%);
}
</style>
